<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>更改主轴方向</title>
    <style>
        .box{
            display: flex;
            /* 更改主轴方向 */
            flex-direction: column;
            width: 300px;
            height: 300px;
            border: 1px solid red;
            /* 更改后为主轴 */
            justify-content: center;
            /* 更改后为侧轴 */
            align-items: center;
        }
        .box div{
            width: 100px;
            height: 100px;
            background-color: pink;
            
        }
    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
    </div>
</body>
</html>